<?php
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

class m_simpanan extends CI_Model {
    function __construct() {
        parent::__construct();
    }

    function sum_simpanan($date){
        return $this->db->query("SELECT t.*, p.URAIAN_PERKIRAAN, bt.TGL_TRANSAKSI
                                FROM (
                                SELECT ID_PERKIRAAN, ID_BUKTI_TRANSAKSI, KODE, sum( JUMLAH ) AS TOTAL
                                FROM detail_bukti_transaksi
                                GROUP BY ID_PERKIRAAN
                                ) t, perkiraan p, bukti_transaksi bt
                                where t.ID_PERKIRAAN = p.KODE_PERKIRAAN and bt.TGL_TRANSAKSI like '$date%'");
    }

}

?>
